﻿using System.ComponentModel;
using CozeDomain.Base;
using FreeSql.DataAnnotations;

namespace CozeDomain.Entities
{
    /// <summary>
    /// 管理员模型
    /// </summary>
    [Table(Name = "SysAdmin")]
    [Description("管理员")]
    public class SysAdminEntity : BaseEntity
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Column(DbType = "varchar", StringLength = 20, IsNullable = false)]
        [Description("手机号")]
        public string? Phone { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [Column(DbType = "varchar", StringLength = 18, IsNullable = false)]
        [Description("账号")]
        public string? Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column(DbType = "varchar", StringLength = 50, IsNullable = false)]
        [Description("密码")]
        public string? Pwd { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [Column(DbType = "varchar", StringLength = 30, IsNullable = true)]
        [Description("昵称")]
        public string? NickName { get; set; }

        /// <summary>
        /// 微信账户
        /// </summary>
        [Column(DbType = "varchar", StringLength = 30, IsNullable = true)]
        [Description("微信账户")]
        public string? WeChartAccount { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [Column(DbType = "varchar", StringLength = 30, IsNullable = true)]
        [Description("邮箱")]
        public string? Email { get; set; }

        /// <summary>
        /// 所属站点,多个逗号隔开
        /// </summary>
        [Column(DbType = "varchar", StringLength = 200, IsNullable = true)]
        [Description("所属站点,多个逗号隔开")]
        public string? TenantIds { get; set; }

        /// <summary>
        /// 上次登录时间
        /// </summary>
        [Column(DbType = "dateTime", IsNullable = true)]
        [Description("上次登录时间")]
        public DateTime? LastLoginTime { get; set; }

        /// <summary>
        /// 上次登录IP地址 
        /// </summar
        [Column(DbType = "varchar", StringLength = 20, IsNullable = true)]
        [Description("上次登录IP地址")]
        public string? LastLoginIp { get; set; }

        /// <summary>
        /// 登录总次数
        /// </summary>
        [Column(DbType = "int", IsNullable = true)]
        [Description("登录总次数")]
        public int? LoginTotalCount { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [Column(DbType = "varchar", StringLength = 500, IsNullable = true)]
        [Description("描述")]
        public string? Description { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [Column(DbType = "bit", IsNullable = false)]
        [Description("状态")]
        public bool? Status { get; set; }
    }
}
